Problem in Displaying image in Mozilla
-
Hi, I am displaying image in html image control without runat=server. The image src is set runtime by some condition, I am using server script for setting image src. This works fine in IE. But it it does not displaying image into Mozilla. I have dibugged the code the function for setting the Image src had called.
Naresh Patel
-
Hi, I am displaying image in html image control without runat=server. The image src is set runtime by some condition, I am using server script for setting image src. This works fine in IE. But it it does not displaying image into Mozilla. I have dibugged the code the function for setting the Image src had called.
Naresh Patel
N a r e s h P a t e l wrote:
The image src is set runtime by some condition, I am using server script for setting image src. This works fine in IE. But it it does not displaying image into Mozilla. I have dibugged the code the function for setting the Image src had called.
So what we can do without seeing a sample code:doh: ? Is your image tag refers from root like
/images/imagename.gif
or it refers like~/images/image.gif
? If your image tag is not runat server then you can remove ~ ( if you are using ).
-
N a r e s h P a t e l wrote:
The image src is set runtime by some condition, I am using server script for setting image src. This works fine in IE. But it it does not displaying image into Mozilla. I have dibugged the code the function for setting the Image src had called.
So what we can do without seeing a sample code:doh: ? Is your image tag refers from root like
/images/imagename.gif
or it refers like~/images/image.gif
? If your image tag is not runat server then you can remove ~ ( if you are using ).
string _ReturnUrl; public string SetImage1(bool _Active) { if (_Active) { _ReturnUrl = Server.MapPath("../images/button-green.gif"); } else { _ReturnUrl = Server.MapPath("../images/button-red.gif"); } return _ReturnUrl; } and accesing in grid view Like " />
Naresh Patel
-
string _ReturnUrl; public string SetImage1(bool _Active) { if (_Active) { _ReturnUrl = Server.MapPath("../images/button-green.gif"); } else { _ReturnUrl = Server.MapPath("../images/button-red.gif"); } return _ReturnUrl; } and accesing in grid view Like " />
Naresh Patel
N a r e s h P a t e l wrote:
_ReturnUrl = Server.MapPath("../images/button-green.gif");
To show image in browser, no need of
Server.MapPath()
. This gives exact location to the image. We need only virtual path. So try removing Server.MapPath
-
string _ReturnUrl; public string SetImage1(bool _Active) { if (_Active) { _ReturnUrl = Server.MapPath("../images/button-green.gif"); } else { _ReturnUrl = Server.MapPath("../images/button-red.gif"); } return _ReturnUrl; } and accesing in grid view Like " />
Naresh Patel
Server.MapPath gives you the physical address of the file on the server. That is useless to the browser, and the only reason that it may work at all is if you are browsing on the same computer that is acting as a server. Just remove Server.MapPath.
--- single minded; short sighted; long gone;
-
Server.MapPath gives you the physical address of the file on the server. That is useless to the browser, and the only reason that it may work at all is if you are browsing on the same computer that is acting as a server. Just remove Server.MapPath.
--- single minded; short sighted; long gone;
Thanks yaar for helping: I got solution: " />
Naresh Patel